/*********  3-1 **********/
import Vue from 'vue';
import Vuex from 'vuex';

// 子模块
import auth from './auth';
import config from './config';

Vue.use(Vuex);

const state = {
    phonebook_list: [],
    Device_message_list: [],
    Sim_message_list: [],
    Device_message_total: 0,
    SIM_message_total: 0,
    message_list: [],
    project: 'PUBLICK',
    platformType: '',
    Device_msg_max_number: 100,
    Sim_msg_max_number: 100,
    globalTimerStopFlag: false
};
const store = new Vuex.Store({
    state,
    modules: {
        auth,
        config
    },
    created() {
        console.log('store created');
        this.dispatch('config/LOAD_CONFIG').then(() => {
            console.log('config loaded');
        });
    }
});

export default store;
